package com.bw.controller;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.bw.service.tmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class tmscontroller {
    @Autowired
    tmsService service;
    @RequestMapping("tms1")
    public JSONObject  tms1(){
        JSONObject jsonObject = new JSONObject();
        int[] arrnum = service.show1();
        JSONArray arr = new JSONArray();
        JSONObject jsonObject1 = new JSONObject();
        jsonObject1.put("name","接单总数");
        jsonObject1.put("value",arrnum[0]);
        JSONObject jsonObject2 = new JSONObject();
        jsonObject2.put("name","下单总数");
        jsonObject2.put("value",arrnum[1]);
        JSONObject jsonObject3 = new JSONObject();
        jsonObject3.put("name","完成单数");
        jsonObject3.put("value",arrnum[2]);
        arr.add(jsonObject1);
        arr.add(jsonObject2);
        arr.add(jsonObject3);
        jsonObject.put("status", 0);
        jsonObject.put("msg", "");
        jsonObject.put("data", arr);
        return jsonObject;
    }
    @RequestMapping("tms2")
    public JSONObject  tms2(){
        JSONObject jsonObject = new JSONObject();


        return jsonObject;
    }
    @RequestMapping("tms3")
    public JSONObject  tms3(){
        JSONObject jsonObject = new JSONObject();


        return jsonObject;
    }
    @RequestMapping("tms4")
    public JSONObject  tms4(){
        JSONObject jsonObject = new JSONObject();


        return jsonObject;
    }
}
